<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
Yii::setPathOfAlias('rootPath','/opt/lampp/htdocs/webvietpro');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return CMap::mergeArray(
	require_once dirname(dirname(__FILE__)).'/modules/poll/config.php', 
 	array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Webvietpro',
	//default controller or module to start
	'defaultController'=>'site_frontend',
	// preloading 'log' component
	//'language'          =>'vi',
	'preload'=>array('log'),
	'theme'	=>	'site',
	// autoloading model and component classes
	'import'=>array(
		'application.models.site.*',
		'application.components.*',
		'ext.giix-components.*', // giix components
		'ext.STranslateableBehavior.*',
	),
	'behaviors' => array('SiteConfigBehavior'),
	'modules'=>array(
		// uncomment the following to enable the Gii tool
			'gii' => array(
				'class' => 'system.gii.GiiModule',
				'generatorPaths' => array(
					'ext.giix-core', // giix generators
				),
				'password'=>'123',
				'ipFilters'=>array('127.0.0.1','::1'),
			),
			'site_frontend',
			'site_shop',
			'poll'
	),

	// application components
	'components'=>array(
		'cache'=>array(
					'class'=>'system.caching.CFileCache',
		),
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		// uncomment the following to enable URLs in path-format
		/*'urlManager'=>array(
			'urlFormat'=>'path',
			'rules'=>array(
				'site_frontend'	=>	'',
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'site_frontend/<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'site_frontend/<controller>/<action>',
				'binh-chon'=>'poll/poll/index',
			),
			//'urlSuffix'		=>	'/',
            'showScriptName'=>false,
		),*/
		
		// uncomment the following to use a MySQL database
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=webvietpro',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
		),
		
		'errorHandler'=>array(
			// use 'site/error' action to display errors
            'errorAction'=>'site_frontend/index/error',
        ),
		/*'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				
			),
		),*/
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'webmaster@example.com',
		'language_default'=>'vi',
		'languages'	=>	array(
									'en'	=>	'English',
									'vi'	=>	'Vietnamese',
		),
	),
)
);
